<form class="form-horizontal" id="form-add-category">


    <div class="form-group">
        <label class="control-label col-xs-2">上级组织结构</label>
        <div class="col-xs-9">
            <input class="form-control" type="text" readonly value="{$parent.title|default='顶级组织'}">
            <input type="hidden" name="parent_id" value="{$parent.id}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">
            组织结构名称
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            <input type="text" class="form-control" name="title" placeholder="输入组织结构名称" required>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">组织结构排序</label>
        <div class="col-xs-9">
            <input type="number" class="form-control" name="order" placeholder="输入排序序号，序号越高，显示越靠前">
        </div>
    </div>

    <div class="form-group">
        <div class="col-xs-offset-2 col-xs-3">
            <button type="submit" class="btn btn-success btn-block">确认添加</button>
        </div>
    </div>
</form>

<script src="__PUBLIC__/vendors/jquery.validation/jquery.validate.min.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/additional-methods.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/messages_zh.min.js"></script>
<script type="application/javascript">
    $(function () {
        $("#form-add-category").validate({
            messages:
                {
                    title: "必须填写组织结构名称"
                },
            debug: true,
            submitHandler: function () {
                ajaxSubmit('form-add-category', true);
            }
        });
    })
</script>